<template>
  <el-container>
    <el-header>
      <Head v-if="userinfo" :userinfo="userinfo"/>
    </el-header>
    <el-main style="width:100%;overflow:hidden">
      <router-view></router-view>
    </el-main>
    <el-footer>
      <Foot/>
    </el-footer>
  </el-container>
</template>

<script>
import Head from "@/components/head.vue"
import Foot from "@/components/foot.vue"
import {getuser} from "@/api"//查询此时的用户
export default {
  components:{
    Head,
    Foot
  },
  data(){
      return{
        userinfo:null
      }
    },
    mounted(){
      getuser()
      .then(res=>{
          if(res.type){
            this.userinfo = res.result
            sessionStorage.setItem("roleid",res.result.roleid) // 记录当前的权限 
            sessionStorage.setItem("username",res.result.username) //存一个用户名，回复意见时要用
          }
      })
    }
};
</script>

<style lang="scss">
.el-header{
    width: 100%;
    // height: 80px !important;
    background: rgb(84, 92, 100);
}
.el-footer{
  width: 100%;
  position: fixed;
  z-index: 10;
  bottom: 0;
  background: rgb(84, 92, 100);
}
.el-main{
  min-height: 650px;
  padding: 10px 50px 0 50px;
  background:url("../assets/images/timg2.jpg") no-repeat;
  background-size: 100% 100% ;
  position: relative;
}
</style>